package org.idea.eaglemq.common.enums;

/**
 * @author: LunBoWang
 * @description: TODO
 * @date: 2025/5/14 下午10:08
 * @version: 1.0
 */

public enum BrokerRegistryRoleEnum {
    MASTER("master"),
    SLAVE("slave"),
    SINGLE("single");

    String code;

    BrokerRegistryRoleEnum(String code) {
        this.code = code;
    }

    public String getCode() {
        return code;
    }

    public static BrokerRegistryRoleEnum of(String code) {
        for (BrokerRegistryRoleEnum value : BrokerRegistryRoleEnum.values()) {
            if (value.getCode().equals(code)) {
                return value;
            }
        }
        return null;
    }
}
